package com.kyle.redpacket.service;

import com.kyle.redpacket.dao.entity.RedPacket;
import com.kyle.redpacket.dao.entity.RedRecord;

import java.util.List;
import java.util.Optional;

public interface IRedService {
    Optional<RedPacket> getRedPacket(String timestamp);
    /**
     * 记录发红包时的全局唯一标识串、随机金额列表和红包个数等信息入数据库
     *
     * @param dto
     * @param list
     * @throws Exception
     */
    void recordRedPacket(RedPacket dto, List<RedRecord> list) throws Exception;

    /**
     * 记录抢红包时记录用户抢到的红包金额等信息入数据库
     *
     */
    void recordRobRedPacket(Long userId,RedRecord result)throws Exception;
}